package orm;

import java.util.ArrayList;
import java.util.Date;

import android.content.Context;

public class Person {
 
    //private variables
    int _id = -1;
    String _title;
    String _fname;
    String _lname;
    String _nation;
    String _gender;
    Date _date_of_birth;
    String _android_id;
    ArrayList<FitnessData> _fitnessData = new ArrayList<FitnessData>();
 
    // Empty constructor
    public Person(){
 
    }
    
    /**
     * Constructor
     * @param id
     * @param title
     * @param fname
     * @param lname
     * @param nation
     * @param gender
     * @param date_of_birth
     * @param android_id
     */
    public Person(int id, String title, String fname, String lname, String nation, String gender, Date date_of_birth, String android_id){
        this._id = id;
        this._title = title;
        this._fname = fname;
        this._lname = lname;
        this._nation = nation;
        this._gender = gender;
        this._date_of_birth = date_of_birth;
        this._android_id = android_id;
    }
 
    
    /** 
     * getting ID
     * @return
     */
    public int getID(){
        return this._id;
    }
 
    /**
     * setting id
     * @param id
     */
    public void setID(int id){
        this._id = id;
    }
    
    /**
     * get title
     * @return
     */
    public String getTitle(){
        return this._title;
    }
 
    /**
     * set title
     * @param title
     */
    public void setTitle(String title){
        this._title = title;
    }
 
    /**
     * getting name
     * @return
     */
    public String getFName(){
        return this._fname;
    }
 
    /**
     * setting name
     * @param fname
     */
    public void setFName(String fname){
        this._fname = fname;
    }
    
    /**
     * getting name
     * @return
     */
    public String getLName(){
        return this._lname;
    }
 
    /**
     * setting name
     * @param lname
     */
    public void setLName(String lname){
        this._lname = lname;
    }
    
    /**
     * get nation
     * @return
     */
    public String getNation(){
        return this._nation;
    }
 
    /**
     * set title
     * @param nation
     */
    public void setNation(String nation){
        this._nation = nation;
    }
 
    /**
     * getting phone number
     * @return
     */
    public String getGender(){
        return this._gender;
    }
 
    /**
     * setting phone number
     * @param gender
     */
    public void setGender(String gender){
        this._gender = gender;
    }
    
    /** 
     * getting phone number
     * @return
     */
    public Date getDateOfBirth(){
        return this._date_of_birth;
    }
 
    /**
     * setting phone number
     * @param date_of_birth
     */
    public void setDateOfBirth(Date date_of_birth){
        this._date_of_birth = date_of_birth;
    }
    
    /**
     * set android unique id
     * @param android_id
     */
	public void setAndroidID(String android_id) {
		this._android_id = android_id;
	}
	
    /**
     * get android unique id
     * @return
     */
	public String getAndroidID() {
		return _android_id;
	}
	
    /**
     * returns the FitnessDataList
     * @return
     */
    public ArrayList<FitnessData> getFitnessDataList(Context context){
    	if(this._fitnessData.size() == 0){
    		this.setFitnessDataList(FitnessDataDBHelper.getFitnessDataByPersonFK(context, this._id));
    	}
        return this._fitnessData;
    }
 
    /**
     * 
     * @param fitnessDataList
     */
    public void setFitnessDataList(ArrayList<FitnessData> fitnessDataList){
        this._fitnessData = fitnessDataList;
    }
    
}